package com.tj.collection.controller.stats.request;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.StringUtils;
import com.fqgj.exception.common.ApplicationException;

/**
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2019/4/2
 * Time: 上午10:22
 */
public class CallsStatisticsRequest extends ParamsObject {

    private String startDate;
    private String endDate;

    public String getStartDate() {
        return startDate;
    }

    public CallsStatisticsRequest setStartDate(String startDate) {
        this.startDate = startDate;
        return this;
    }

    public String getEndDate() {
        return endDate;
    }

    public CallsStatisticsRequest setEndDate(String endDate) {
        this.endDate = endDate;
        return this;
    }

    @Override
    public void validate() {
        if (StringUtils.isEmpty(startDate) || StringUtils.isEmpty(endDate)) {
            throw new ApplicationException("Start and stop time should not be empty");
        }
    }
}
